<template>
	<view>
		<!-- <cu-custom :isBack="true">
			<block slot="content"></block>
		</cu-custom> -->
		<view>
			<up-loading-page :loading="true" loadingText="loading..." v-if="showLoading"></up-loading-page>
		</view>
		<view v-show="!showLoading">
			<view class="viewbox" style="background-color: #fff;"></view>
			
			
			<view class="group1">
				<!--此处插入蓝色背景图-->
				<image src="../../static/我的_bg@3x.png"></image>
			</view>
			
			<view class="group2">
				<image class="img1" :src="information.avatar"></image>
				<view class="t1">{{ information.nickname }}</view>
				<navigator url="/pages/account-setting/account-setting"><image class="img2" src="../../static/设置@2x.png"></image></navigator>
			</view>
			
			<view class="group3">
				<!--此处为会员余额和积分-->
				<view class="p1">
					<view class="parse1">
						<navigator url="/pages/balance/balance"><view class="text1">会员余额</view></navigator>
						<navigator url="/pages/balance/balance"><view class="text2">￥<text>{{  information.user_money }}</text></view></navigator>
					</view>
					<image class="img1" src="../../static/会员余额@2x.png"></image>
				</view>
				
				<image class="image3" src="../../static/竖线.png"></image>
				
				<view class="p2">
					<view class="parse1">
						<navigator url="/pages/integral/integral"><view class="text1">积分</view></navigator>
						<navigator url="/pages/integral/integral"><view class="text2"><text>{{ information.user_integral }}</text></view></navigator>
					</view>
						<image class="img1" src="../../static/积分@2x.png"></image>
				</view>
			</view>
			
			<view class="group4">
				<view class="parse1">
					<view class="text1">积分订单</view>
					<navigator url="/pages/my-order/my-order"><view class="text2">全部</view></navigator>
					<navigator url="/pages/my-order/my-order"><image src="../../static/箭头@2x.png"></image></navigator>
				</view>
				<view class="parse2">
					<view class="item" @click="goToOrderPage('待付款')">
					
						<image src="../../static/兑换@2x.png"></image>
						<text>待付款</text>
					</view>
					<view class="item" @click="goToOrderPage('待发货')">
						<image src="../../static/待发货@2x.png"></image>
						<text>待发货</text>
					</view>
					<view class="item" @click="goToOrderPage('待收货')">
						<image src="../../static/待收货@2x.png"></image>
						<text>待收货</text>
					</view>
					<view class="item" @click="goToOrderPage('已完成')">
						<image src="../../static/已完成@2x.png"></image>
						<text>已完成</text>
					</view>
				</view>
			</view>
			
			<view class="group5">
				<navigator url="/pages/help/help" class="parse1">
					<view><image class="img1" src="../../static/我的收藏@2x.png"></image></view>
					<view><view class="t1">使用帮助</view></view>
					<view><image class="img2" src="../../static/箭头@2x.png"></image></view>
				</navigator>
				<navigator url="/pages/cooperation/cooperation" class="parse2">
					<image class="img1" src="../../static/合作反馈@2x.png"></image>
					<view class="t1">合作反馈</view>
					<image class="img2" src="../../static/箭头@2x.png"></image>
				</navigator>
				<navigator url="/pages/user_address/user_address" class="parse3">
					<image class="img1" src="../../static/我的地址@2x.png"></image>
					<view class="t1">收货地址</view>
					<image class="img2" src="../../static/箭头@2x.png"></image>
				</navigator>
			</view>
		</view>
	</view>
</template>
<script setup>
import { ref,onMounted } from 'vue'
import request from '@/common/request.js';
import {
	loadingType
} from '@/utils/type';

const showLoading = ref(true)

onMounted(() => {
  setTimeout(() => {
    showLoading.value = false;
  }, 1000);
});
const type = ref('warning');  
const value = ref(100);

// 东西

onMounted(()=>{
	loginfo()
})

const information = ref({
	after_sale:0,
	avatar:'',
	earnings:'',
	finish:0,
	id:0,
	is_new_user:0,
	mobile:'',
	nickname:'',
	sn:'',
	total_order_amount:'',
	user_integral:'',
	user_money:'',
	wait_delivery:'',
	wait_pay:'',
	wait_take:''
})

const loginfo = ()=>{
	const uid = uni.getStorageSync('uid')
	uni.request({
		url:request.baseUrl+ 'u-role_config',
		method:'GET',
		data: {
		      uid: uid // 传递 uid 作为 Query 参数
		},
		success: (res) => {
		console.log(res)
		if(res.data.code===200){
			information.value = res.data.data
			console.log("得到",information.value)
		}else{
			console.log(res.data.data)
		}
		// addressObj.value = res.data.data
		// console.log("得到",addressObj.value)
		// console.log("code的",uid)
		},
	})
}

// 跳转
function goToOrderPage(status) {
  uni.navigateTo({
    url: `/pages/my-order/my-order?status=${status}` // 跳转并传递状态
  });
}


 </script>

<style lang="scss" scoped>

	.group1{
		image{
			width: 100%;
			height: 485rpx;
			position: fixed;
			z-index: -1;
		}
	}
	.group2{
		display: flex;
		.img1{
			width: 120rpx;
			height: 116rpx;
			margin-top: 120rpx;
			margin-left: 54rpx;
		}
		.t1{
			font-size: 40rpx;
			font-weight: bold;
			margin-top: 157rpx;
			margin-left: 26rpx;
			z-index: 1;
		}
		.img2{
			width: 41rpx;
			height: 37rpx;
			margin-top: 170rpx;
			margin-left: 344rpx;
		}
	}
	.group3{
		width: 710rpx;
		height: 170rpx;
		border-radius: 20rpx;
		background-color: #f6f6f6;
		margin-left: 20rpx;
		margin-top: 108rpx;
		z-index: 10;
		display: flex;
		.p1{
			display: flex;
			.parse1{
				.text1{
					font-size: 22rpx;
					padding-top: 46rpx;
					padding-left: 28rpx;
				
				}
				.text2{
					font-size: 22rpx;
					color: #ff8400;
					padding-left: 28rpx;
					padding-top: 10rpx;
					text{
						font-size: 48rpx;
						color: #ff8400;
					}
				}
			}
			.img1{
				position: absolute;
				margin-left: 280rpx;
			width: 70rpx;
			height: 70rpx;
			padding-top: 47rpx;
			
			}
		}
		.image3{
			position: absolute;
			margin-left:400rpx;
			background-color: #bfbfbf;
			width: 1rpx;
			height: 107rpx;
			margin-top: 28rpx;
			
		}
		.p2{
			display: flex;
			position: absolute;
			margin-left:400rpx;
			.parse1{
				.text1{
					font-size: 22rpx;
					padding-top: 46rpx;
					padding-left: 28rpx;
				
				}
				.text2{
					font-size: 22rpx;
					color: #ff8400;
					padding-left: 28rpx;
					padding-top: 10rpx;
					text{
						font-size: 48rpx;
						color: #ff8400;
					}
				}
			}
			.img1{
				position: absolute;
				margin-left: 200rpx;
			width: 70rpx;
			height: 70rpx;
			padding-top: 47rpx;
			
			}
		}
		
	}
	.group4{
		width: 710rpx;
		height: 240rpx;
		margin-top: 32rpx;
		margin-left: 20rpx;
		background-color:  #f6f6f6;
		border-radius: 20rpx;
		.parse1{
			display: flex;
			
			.text1{
				font-size: 28rpx;
				padding-top: 39rpx;
				padding-left: 35rpx;
				font-weight: bold;
				z-index: 1;
			}
			.text2{
				padding-top: 41rpx;
				margin-left: 437rpx;
				font-size: 24rpx;
				color: #a3a3a3;
			}
			image{
				width: 9rpx;
				height: 16rpx;
				padding-top: 45rpx;
				padding-left: 19rpx;
			}
		}
		.parse2{
			display: flex;
			.item{
				display: flex;
				flex-direction: column;
				align-items: center;
				padding-left: 80rpx;
				z-index: 1;
				.box{
					position: absolute;
					margin-top: 25rpx;
					margin-left: 80rpx;
					z-index: 1;
					width: 40rpx;
					color: "#5beaf6";
					
				}

				image{
				width: 50rpx;
				height: 50rpx;
				margin-top: 49rpx;

				}
				text{
					padding-top: 10rpx;
					font-size: 24rpx;
				}
			}
			
		}
			
	}
	.group5{
		width: 710rpx;
		height: 338rpx;
		background-color:  #f6f6f6;
		border-radius: 20rpx;
		margin-top: 16rpx;
		margin-left: 20rpx;
		.parse1{
			display: flex;
			.img1{
				width: 40rpx;
				height: 40rpx;
				margin-left: 48rpx;
				margin-top: 49rpx;
				
			}
			.t1{
				font-size: 30rpx;
				padding-left: 29rpx;
				padding-top: 47rpx;
			}
			.img2{
				width: 9rpx;
				height: 16rpx;
				padding-left: 429rpx;
				padding-top: 58rpx;
			}
		}
		.parse2{
			display: flex;
			.img1{
				width: 40rpx;
				height: 40rpx;
				margin-left: 48rpx;
				margin-top: 49rpx;
				
			}
			.t1{
				font-size: 30rpx;
				padding-left: 29rpx;
				padding-top: 47rpx;
			}
			.img2{
				width: 9rpx;
				height: 16rpx;
				padding-left: 429rpx;
				padding-top: 58rpx;
			}
		}
		.parse3{
			display: flex;
			.img1{
				width: 40rpx;
				height: 40rpx;
				margin-left: 48rpx;
				margin-top: 49rpx;
				
			}
			.t1{
				font-size: 30rpx;
				padding-left: 29rpx;
				padding-top: 47rpx;
			}
			.img2{
				width: 9rpx;
				height: 16rpx;
				padding-left: 429rpx;
				padding-top: 58rpx;
			}
		}
	}

</style>